<template>
  <div>
    <img src="../assets/O4X.gif" alt />
    <p :style="{backgroundColor: color}" @click="btn">这是一个写不出来代码的程序猿</p>
  </div>
</template>

<script>
export default {
  name: "tupian",
  data() {
    return {
      color: "",
    };
  },
  methods: {
    btn() {
      this.color = `rgb(${Math.floor(Math.random() * 256)}, ${Math.floor(
        Math.random() * 256
      )}, ${Math.floor(Math.random() * 256)})`;
    },
  },
};
</script>

<style scoped>
img {
  width: 400px;
}
</style>